// cookic的封装
const TokenKey = "admin-token";
const passwordKey = "admin-userNameAndPassword";

// 获取
export const getToken = () => {
    return localStorage.getItem(TokenKey);
};
// 设置
export const setToken = (val: string) => {
    return localStorage.setItem(TokenKey, val);
};
// 清除
export const removeToken = () => {
    return localStorage.removeItem(TokenKey);
};
// 获取账号密码
export const getNameAndPas = () => {

    let data = JSON.parse(localStorage.getItem(passwordKey) as string)
    return data
}
// 设置账号密码
export const setNameAndPas = (value: any) => {
    return localStorage.setItem(passwordKey, JSON.stringify(value))
}
// 移除账号密码
export const removeNameAndPas = () => {
    return localStorage.removeItem(passwordKey)
}